package communicationMessages;

import data.MemberDataBase;

public class LogoutMessage extends Message {

	@Override
	public String getAnswer() {
		
		
		String tContent = new String(this.getContent());
		int endOfUserName = tContent.indexOf('\n');
		String userName = tContent.substring(0, endOfUserName);
		MemberDataBase uDataBase = MemberDataBase.getMembersDataBase();
		uDataBase.removeLoginMember(uDataBase.getMember(userName));
		System.out.println(userName + " logout");
		String ans = "logout\n";
		return ans;
	}

}
